package cn.changshengjue.dakong.command.sub;

import java.util.List;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

import cn.changshengjue.dakong.main;
import cn.changshengjue.dakong.api.apiImpl;
import cn.changshengjue.dakong.command.CommandHandler;
import cn.changshengjue.dakong.command.SubCommand;
import cn.changshengjue.dakong.command.type.AdminCommand;
import cn.changshengjue.dakong.config.cfg;

public class ReloadCommand extends SubCommand implements AdminCommand {
	public ReloadCommand() {
		super("reload", "/dk reload", main.getInstance().getConfig().getString("commands.reload"));
	}

	@Override
	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
		main.getInstance().reloadConfig();
		cfg.loadConfig();
		
		main.setCommandHandler(new CommandHandler("dk"));
		sender.sendMessage(cfg.MSG_PLUGIN + cfg.MSG_RELOAD);
		System.out.println(new apiImpl().isFBNumber("test", Bukkit.getPlayer(sender.getName())));
		return false;
	}
	@Override
	public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
		return null;
	}
}
